#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std; 

typedef long long ll; 

#define N 300

char stack[N]; 
char s[N]; 
int top; 

int main()
{
	char *p;
	
	//freopen("p1739_1.in", "r", stdin); 
	scanf("%s", s); 
	for (p=s; *p && top>=0; p++) {
		if (*p=='(') {
			stack[top++] = *p; 
		} else if (*p==')') {
			top--; 
		}
	}
	printf(top ? "NO\n" : "YES\n"); 
	return 0; 
}


